<%
//用户
var user = shiro.getUser();
%>

<!-- 一体机导航 -->
<nav class="navbar navbar-inverse navbar-fixed-top"  id="raioIndex" >
    <div class="container" >
        <div class="navbar-header">
            <button type="button" class="navbar-toggle pull-right collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
                <span class="sr-only">切换导航</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand hidden visible-xs" href="/" title="LOGO">智慧洛龙</a>
        </div>
        <div class="collapse navbar-collapse" id="navbar-collapse">
            <ul class="nav navbar-nav">
                <li><a href="/">首 页</a></li>
			</ul>
            <ul class="nav navbar-nav user-line navbar-right">
                <% if(shiro.isGuest()){ %>
                <li><a href="/user/login">用户登陆</a></li>
                <li><a href="/user/register">用户注册</a></li>
                <% } else { %>
                <li><a><strong class="text-danger">${user.userName}</strong></a></li>
                <li><a href="/user/index">会员中心</a></li>
                <li><a href="/user/logout">退出登录</a></li>
                <% } %>
            </ul>
        </div>
    </div>
</nav>
<!--  web导航-->
<nav class="navbar navbar-inverse navbar-fixed-top"  id="webIndex">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle pull-right collapsed" data-toggle="collapse" data-target="#navbar-collapse" aria-expanded="false">
                <span class="sr-only">切换导航</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand hidden visible-xs" href="/" title="LOGO">智慧法院</a>
        </div>
        <div class="collapse navbar-collapse" id="navbar-collapse">
            <ul class="nav navbar-nav">
                <li><a href="/">首页</a></li>
			</ul>
            <ul class="nav navbar-nav user-line navbar-right">
                <% if(shiro.isGuest()){ %>
                <li><a href="/user/personLogin">个人登陆</a></li>
                <li><a href="/user/legalLogin">法人登录</a></li>
                <% } else { %>
                <li><a><strong class="text-danger">${user.userName}</strong></a></li>
                <li><a href="/user/index">会员中心</a></li>
                <li><a href="/user/logout">退出登录</a></li>
                <% } %>
            </ul>
        </div>
    </div>
</nav>
<%
var cuurentUrl = request.requestURI;
var userList = ["register","login","resetPassword"];
var isSearchShow = array.contain(userList,cuurentUrl);
%>
<section class="container mb15">
    <div class="col-sm-3 pull-left hidden-xs">
        <a href="${session.windowOffices==null?'/':'/windowOffices'}"><img src="/static/images/logo.png"></a>
    </div>
    <% if(session.windowOffices==null){%>
     <div class="col-sm-1 pull-left hidden-xs" hidden onmouseover="show();" onmouseout="hide();">
        <div class="btn btn-primary" >
		 <!--<i class="iconfont icon-bumen"></i>部门-->
	    </div>
		 <div id="dept" class="row mt15" style="display:none;position: absolute;width: 1000px;height: 175px;padding-bottom: 20px;top: 22px;left: -398px;z-index: 9999;">
		    <div class="panel panel-primary search-index">
		        <div class="panel-body criteria">
					<dl id="deptList">
					</dl>
				</div>
		    </div>
		</div>
    </div>
    <% }%>
    <!--<div class="col-sm-6 pull-right ${!isSearchShow?'hidden-xs'}">-->
        <!--<form action="/search" class="topsearch">-->
            <!--<div class="input-group">-->
                <!--<input type="text" class="form-control" id="keyword" name="keyword"  value="${keyword!}"  placeholder="搜索事项...">-->
                <!--<span class="input-group-btn">-->
                    <!--<button class="btn btn-default search-button" type="submit" id="item-search">搜索一下</button>-->
                <!--</span>-->
            <!--</div>-->
        <!--</form>-->
    <!--</div>-->
</section>
<script>
$.ajax({
    type:"POST",
    url:"/deptList",
    dataType:"json",
    success:function(data){
      if(data.success){
    	  var html="";
    	  $.each(data.rows,function(i,dept){
    		  html+="<dd><a href=\"/itemList/dept/"+dept.orgCode+"\" >"+dept.orgName+"</a></dd>";
    		 });
    	  $("#deptList").html(html);
      }
    },
    error:function(jqXHR){
        console.log("Error: "+jqXHR.status);
    }
});
function show(){
	   document.getElementById('dept').style.display = 'block';
}
function hide(){
	    document.getElementById('dept').style.display ='none';
}
</script>

